/*
 * @Description: 
 * @Author: zoe
 * @Date: 2024-10-09 20:04:06
 * @LastEditors: rendc
 * @LastEditTime: 2024-10-09 20:09:20
 */
public class ReturnExceptionDemo{
    public static void methodA() throws Exception
    {
        try{
            System.out.println("进入方法A");
            throw new Exception("制造异常");
        }finally{
            System.out.println("方法A的finally代码块");
        }
    }
    public static int methodB(){
        try{
            System.out.println("进入方法B");
            return 1;
        }finally{
            System.out.println("用B的finally");
            return 2;
        }
    }
    public static void main(String[] args){
        try{
            methodA();
        }catch(Exception e){
            System.out.println(e.getMessage());
        }
        int i = methodB();
        System.out.println(i);
    }
}